// // For more information about this file see https://dove.feathersjs.com/guides/cli/service.schemas.html
import { resolve } from '@feathersjs/schema'
import { Type, getValidator, querySyntax } from '@feathersjs/typebox'
import { dataValidator, queryValidator } from '../../validators.js'

// Main data model schema
export const gdBaseInfoSchema = Type.Object(
  {
    id: Type.Number(),
    text: Type.String(),
    toolName: Type.String(),
    worlVol: Type.String()
  },
  { $id: 'GdBaseInfo', additionalProperties: true }
)
export const gdBaseInfoValidator = getValidator(gdBaseInfoSchema, dataValidator)
export const gdBaseInfoResolver = resolve({})

export const gdBaseInfoExternalResolver = resolve({})

// Schema for creating new entries
export const gdBaseInfoDataSchema = Type.Pick(gdBaseInfoSchema, ['text'], {
  $id: 'GdBaseInfoData'
})
export const gdBaseInfoDataValidator = getValidator(gdBaseInfoDataSchema, dataValidator)
export const gdBaseInfoDataResolver = resolve({})

// Schema for updating existing entries
export const gdBaseInfoPatchSchema = Type.Partial(gdBaseInfoSchema, {
  $id: 'GdBaseInfoPatch'
})
export const gdBaseInfoPatchValidator = getValidator(gdBaseInfoPatchSchema, dataValidator)
export const gdBaseInfoPatchResolver = resolve({})

// Schema for allowed query properties
export const gdBaseInfoQueryProperties = Type.Pick(gdBaseInfoSchema, ['id', 'text'])
export const gdBaseInfoQuerySchema = Type.Intersect(
  [
    querySyntax(gdBaseInfoQueryProperties),
    // Add additional query properties here
    Type.Object({}, { additionalProperties: false })
  ],
  { additionalProperties: false }
)
export const gdBaseInfoQueryValidator = getValidator(gdBaseInfoQuerySchema, queryValidator)
export const gdBaseInfoQueryResolver = resolve({})
